home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / amicad / arexx_english / textframe.amicad < prev    next >
Text File  |  1998-08-09  |  1KB  |  46 lines

  1. /* This script creates a  frame around the selected texts. */
  2. /* $VER: CadrerTexte 1.02e (© R.Florac, 09/08/98) */
  3. /* Only normal texts can be used, rotations are not handled */
  4.  
  5. options results
  6.  
  7. signal on error
  8. signal on syntax
  9.  
  10. 'FIRSTSEL'; obj=result
  11. if obj=0 then do
  12.     'MESSAGE("No selected text")'
  13.     exit
  14. end
  15.  
  16. xg=100000; xd = 0; yh = 10000; yb = 0
  17. do while obj>0
  18.     'TYPE('obj')'
  19.     if result ~= 4 then do
  20.     'BLINK('obj')'
  21.     'MESSAGE("Incorrect object type"+CHR(10)+"Only select texts please")'
  22.     exit
  23.     end
  24.     'COORDS('obj')'; coord=result
  25.     PARSE VAR coord x0 ',' y0
  26.     if x0<xg then xg=x0
  27.     if y0>yb then yb=y0
  28.     'WIDTH('obj')'; x0=x0+result
  29.     if x0>xd then xd=x0
  30.     'HEIGHT('obj')'; y0=y0-result
  31.     if y0<yh then yh=y0
  32.     'NEXTSEL('obj')'; obj=result
  33. end
  34. xg=xg-4; xd=xd+6; yh=yh; yb=yb+3
  35. 'SAVEALL(-1):DRAWMODE(-1):MARK(DRAW('xg','yh','xd','yh')):MARK(DRAW('xg','yh','xg','yb')):DRAWMODE(-2):MARK(DRAW('xd','yh'+1,'xd','yb')):MARK(DRAW('xg'+1,'yb','xd','yb')):MENU("Group")'
  36. exit
  37.  
  38. syntax:
  39. erreur=RC
  40. 'MESSAGE("Script TextFrame"+"Syntax error"+CHR(10)+"in line 'SIGL'"+CHR(10)+"'errortext(erreur)'")'
  41. exit
  42.  
  43. error:
  44. 'MESSAGE("Script TextFrame"+"Error in line 'SIGL'")'
  45. exit
  46.